package com.ysz.aop;

import org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName ConfigurableAdvisorConfig
 * @Description TODO
 * @Data 19:50
 * @Version 1.0
 * @Author ysz
 */
@Configuration
public class ConfigurableAdvisorConfig {
    @Value("${com.feihe.execution4Args}")
    private String execution4Args;

    @Bean
    public AspectJExpressionPointcutAdvisor configurableAdvisor(AutoAddConfig autoAddConfig) {
        AspectJExpressionPointcutAdvisor advisor =
                new AspectJExpressionPointcutAdvisor();
        advisor.setExpression(execution4Args);
        advisor.setAdvice(autoAddConfig);
        return advisor;
    }
}
